<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/inc/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>下订单</title>
		<link type="text/css" rel="stylesheet" href="${path }/css/common.css">
		<script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script>
		<script src="/js/wbox.js" type="text/javascript"></script>
		<link href="/css/wbox/wbox.css" rel="stylesheet" type="text/css" />
		<style type="text/css">
			body{
				font:12px/1.75 Tahoma,Arial;color:#333;
			}
		</style>
		
		<script type="text/javascript">
			var path="${path}";
		</script>
		<script type="text/javascript">
			function changeShippingFee(shippingBasePrice){
				$("#shippingFee").val(shippingBasePrice)
			}
		</script>
	</head>
	<body>
		<form action="/goods/order/save" method="post" id="saveForm">
			<div id="cart" style="width:800px;height:500px;">
				<p>订单列表</p>
				<table class='Table' cellpadding='0' cellspacing='0' width='100%'>
					<tr>
						<td>
							订单编号
						</td>
						<td>
							订单商品
						</td>
						<td>
							收货人
						</td>
						<td>
							订单金额
						</td>
						<td>
							下单时间
						</td>
						<td>	
							订单状态
						</td>
						<td>
							操作
						</td>
					</tr>
					<c:forEach items="${orders}" var="order">
						<tr>
							<td>
								${order.orderSn }
							</td>
							<td>
								<div id="div${order.orderSn}">
									
								</div>
								<script type="text/javascript">
									$.getJSON(
										'/order/goods/${order.orderSn}',
										function(json){
										
											var html = document.getElementById("div${order.orderSn}").innerHTML;
											$.each(json, function(i, item){
												html += "<font color='red'>"+item.goodsName +"</font><br>";
												$("#div${order.orderSn}").html(html);
											});
										}
									);
								</script>
							</td>
							<td>
								${order.consignee }
							</td>
							<td>
								${order.orderAmount }
							</td>
							<td>
								<fmt:formatDate value="${order.addTime }" pattern="yyyy-MM-dd HH:mm"/>
							</td>
							<td>
								<c:if test="${order.payStatus == 0}">
									<a href="/pay/index?orderNo=${order.orderSn }&orderType=2">支付</a>
								</c:if>
							</td>
							<td width="100px">
							
							</td>
						</tr>
					</c:forEach>
					
				</table>
				
				
			</div>
		</form>
	</body>
</html>